﻿
@{
    ViewData["Title"] = "Workshop";
    Layout = "~/Views/Home/Main.cshtml";
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>车间管理/车间列表</title>
    <link href="~/layui/css/layui.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.2/xlsx.full.min.js"></script>
</head>
<body>
    <div class="layui-container">
        <h3>车间管理 / 车间列表</h3>
        <div class="layui-form">
            <div class="layui-form-item layui-inline">
                <label class="layui-form-label">车间编号</label>
                <div class="layui-input-inline">
                    <input type="text" id="workshopNumber" name="workshopNumber" placeholder="请输入车间编号" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item layui-inline">
                <label class="layui-form-label">车间名称</label>
                <div class="layui-input-inline">
                    <input type="text" id="workshopName" name="workshopName" placeholder="请输入车间名称" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item layui-inline">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-block">
                    <select id="statusSelect" name="status" lay-verify="required">
                        <option value="">请选择状态</option>
                        <option value="true">正常</option>
                        <option value="false">异常</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item layui-inline">
                <div class="layui-input-block">
                    <button type="button" class="layui-btn layui-btn-normal" id="AddWorkshop"><i class="layui-icon"></i> 添加</button>
                    <button type="button" class="layui-btn layui-btn-primary" id="exportBtn">导出</button>
                    <button type="button" class="layui-btn layui-btn-primary" id="resetForm">重置</button>
                    <button type="button" class="layui-btn layui-btn-normal" id="searchWorkshops">查询</button>
                </div>
            </div>            
        </div>
        <div style="width:1058px;margin-left:30px">
            <table class="layui-table" id="workshopTable">
            </table>
        </div>
    </div>
    <!-- 在某个元素中嵌入 ApiUrl -->
    <div id="apiUrl" data-url="@Model.ApiUrl"></div>
    <script src="~/js/m_shopmachine/workshop.js?n=" + new Date()></script>
    <script type="text/html" id="barDemo">
        <div>
            {{#  if(d.State === true){ }}
            <a style="color:dodgerblue;margin-right:5px" lay-event="edit">编辑</a>
            <a style="color:dodgerblue;margin-right:5px" lay-event="view">查看</a>
            <a style="color:dodgerblue;margin-right:5px" lay-event="stop">停工</a>
            {{#  } else if(d.State === false){ }}
            <a style="color:dodgerblue;margin-right:5px" lay-event="edit">编辑</a>
            <a style="color:dodgerblue;margin-right:5px" lay-event="view">查看</a>
            <a style="color:dodgerblue;margin-right:5px" lay-event="recover">恢复</a>
            {{#  } }}
        </div>
    </script>
</body>
</html>